package com.leetcode.August;

/**
 * @Description: 9. 回文数
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-30 15:48
 */
public class LC9回文数 {
    public boolean isPalindrome(int x) {
        String X = Integer.toString(x);
        int left=0,right=X.length()-1;
        while (left<right){
            if (X.charAt(left)!=X.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
